from sklearn.manifold import TSNE


def run(df, params):
    df = df.dropna()

    k = int(params["k"])

    pred = TSNE(k).fit_transform(df[params["cols"]].values).astype(float)

    output_cols = []
    for i in range(pred.shape[1]):
        output_col = "_tsne_{}_".format(i + 1)
        output_cols.append(output_col)
        df[output_col] = pred[:, i]

    return df
